home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
3.1
/
toasterall
/
arexx_examples
/
tpaint
/
tplaser.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-05-13
|
3KB
|
116 lines
/* TP Animate Beam! */
/* © 1993 NewTek, Inc. by Arnie Cachelin */
PARSE ARG x1 y1 x2 y2 frames savename startframe loadname
if x1="" | x2="" | y2="" | y1="" | frames="" | savename="" then do
say "Usage: rx TPLaser x1 y1 x2 y2 frames savename [startframe [loadname]]"
exit
end
Address "DigiPaint" /* Tell ARexx where commands go */
if pos("DigiPaint",show(ports))=0 then do
say "Can't find ToasterPaint!"
exit
end
if startframe="" then startframe=0
'Mine' /* Set Edge transparency to 0% */
'Midc' /* Set Center transparency to 50% */
'Pmcl' /* Set to normal paint mode */
'Bsmo'
'Hvon'
xstep=((x2-x1)/frames)
ystep=((y2-y1)/frames)
pulselen=4
do i=1 to frames+pulselen
if loadname ~="" then say 'Call LoadRGB('loadname||right(i+startframe,3,"0")')'
if loadname ~="" then Call LoadRGB(loadname||right((i+startframe),3,"0"))
dx=(i*xstep)%1
dy=(i*ystep)%1
pulse=(i-pulselen)
if pulse>0 then do
px=(pulse*xstep)%1
py=(pulse*ystep)%1
x=x1 + px
y=y1 + py
say 'Pulse End:' pulse px py x y dx dy
end
else do
x=x1
y=y1
say x y
end
'Pend' x y
x=x1+dx
y=y1+dy
if i>frames then do
x=x2
y=y2
say "Hit At (" x y ")"
end
'Move' x y
'Pend' x y
'Penu' x y
say x1'+'dx y1'+'dy x y
'Shco'
/* 'Undo' */
say 'Call SaveRGB('savename||right(i+startframe,3,"0")')'
Call SaveRGB(savename||right(i+startframe,3,"0"))
end
exit
SetFile: PROCEDURE /* Select file in current requester */
arg file
dirname=GetPathName(file)
'Dnam'dirname /* Enter file path */
'Dsel' /* Hit return on directory */
'Dnam'dirname /* Enter file path */
'Dsel' /* Hit return on directory */
filename=GetFileName(file)
'Fnam'filename /* Enter File name */
'Okls' /* Hit the OK button */
return
LoadFrameStore: PROCEDURE /* Load FrameStore */
arg filename /* must have ###.fs on front! */
'Loco' /* Call file requester */
'Fnam'filename /* Enter File name */
'Okls' /* Hit the OK button */
return 0
SaveFrameStore: PROCEDURE /* Save FrameStore */
arg filename /* must have ###.fs on front! */
'Saco' /* Call file requester */
'Fnam'filename /* Enter File name */
'Okls' /* Hit the OK button */
return 0
LoadRGB: PROCEDURE /* Load IFF RGB, copy into swap buffer */
arg filename
'Lo24' /* Call file requester */
Call SetFile(filename)
return
SaveRGB: PROCEDURE /* Save IFF RGB, copy into swap buffer */
arg filename
'Sa24' /* Call file requester */
Call SetFile(filename)
return
GetFileName: procedure /* Extract file name from full file specification */
ARG fullfile
c = lastpos("/",fullfile)
if c = 0 then c = lastpos(":",fullfile)
return substr(fullfile, c + 1)
GetPathName: procedure /* Extract directory name from full file specification */
ARG fullfile
c = lastpos("/",fullfile)
if c = 0 then c = lastpos(":",fullfile)
return left(fullfile,c)